package com.sellerSystem.service.Impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sellerSystem.dao.SellerDao;
import com.sellerSystem.service.SellerManager;
import com.sellerSystem.vo.Commodity;
import com.sellerSystem.vo.OrderForm;
import com.sellerSystem.vo.Seller;

@Service("sm")
public class SellerManagerImpl implements SellerManager {
	@Autowired(required = true)
	private SellerDao sd;

	@Override
	public int regist(Seller seller) {
		// TODO Auto-generated method stub
		return sd.addSeller(seller);
	}

	@Override
	public Seller login(String sellerTel, String sellerPsd) {
		// TODO Auto-generated method stub

		return sd.findSeller(sellerTel, sellerPsd);
	}

	@Override
	public int modifyPsd(String sellerTel, String sellerPsd) {
		// TODO Auto-generated method stub
		int rs = sd.modifyPsd(sellerTel, sellerPsd);
		return rs;
	}

	@Override
	public boolean isExist(String sellerTel) {
		// TODO Auto-generated method stub
		return sd.findTel(sellerTel);
	}

	@Override
	public int addCommodity(Commodity commodity) {
		// TODO Auto-generated method stub
		return sd.addCommodity(commodity);
	}

	@Override
	public int modifyCommodity(Commodity commodity) {
		// TODO Auto-generated method stub
		return sd.modifyCommodity(commodity);
	}

	@Override
	public int deleteCommodity(Commodity commodity) {
		// TODO Auto-generated method stub
		int rs = sd.deleteCommodity(commodity);

		return rs;
	}

	@Override
	public Commodity queryCommodity(Integer commodityId) {
		// TODO Auto-generated method stub

		return sd.queryCommodity(commodityId);
	}

	@Override
	public String accounts() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void checkEvaluation() {
		// TODO Auto-generated method stub

	}

	@Override
	public  ArrayList<Commodity> findCommodity(String sellerName) {
		// TODO Auto-generated method stub
		return sd.findCommodity(sellerName);
	}

	@Override
	public ArrayList<Seller> seller() {
		// TODO Auto-generated method stub
		return sd.seller();
	}

	@Override
	public Seller findId(int sellerId) {
		// TODO Auto-generated method stub
		return sd.findId(sellerId);
	}

}
